﻿using System;
using System.Collections.Generic;

namespace gvPoco.ChartOptions
{
    public abstract class BaseOptions : IChartOptions
    {
        /// <summary>
        /// The background color for the main area of the chart. Can be either a simple HTML color string, for example: 
        /// 'red' or '#00cc00', or an object with the following properties.
        /// </summary>
        public BackgroundColor backgroundColor { get; set; }

        /// <summary>
        /// An object with members to configure the placement and size of the chart area 
        /// (where the chart itself is drawn, excluding axis and legends). Two formats 
        /// are supported: a number, or a number followed by %. A simple number is a 
        /// value in pixels; a number followed by % is a percentage. 
        /// Example: chartArea:{left:20,top:0,width:"50%",height:"75%"}
        /// </summary>
        public ChartArea chartArea { get; set; }

        /// <summary>
        /// The colors to use for the chart elements. An array of strings, where each element 
        /// is an HTML color string, for example: colors:['red','#004411'].
        /// </summary>
        public string[] colors { get; set; }

        /// <summary>
        /// The default font size, in pixels, of all text in the chart. 
        /// You can override this using properties for specific chart elements.
        /// </summary>
        public int fontSize { get; set; }

        /// <summary>
        /// The default font face for all text in the chart. 
        /// You can override this using properties for specific chart elements.
        /// </summary>
        public string fontName { get; set; }

        /// <summary>
        /// Height of the chart, in pixels.
        /// </summary>
        public string height { get; set; }

        /// <summary>
        /// If set to true, displays a three-dimensional chart.
        /// </summary>
        public bool is3D { get; set; }

        /// <summary>
        /// An object with members to configure various aspects of the legend.
        /// </summary>
        public Legend legend { get; set; }

        /// <summary>
        /// Text to display above the chart.
        /// </summary>
        public string title { get; set; }

        /// <summary>
        /// Where to place the chart title, compared to the chart area. 
        /// Supported values: in, out, none
        /// </summary>
        public string titlePosition { get; set; }

        public TextStyle titleTextStyle { get; set; }

        /// <summary>
        /// An object with members to configure various tooltip elements.
        /// </summary>
        public ToolTip tooltip { get; set; }

        /// <summary>
        /// Width of the chart, in pixels.
        /// </summary>
        public string width { get; set; }

        /// <summary>
        /// The type of Chart the options are being set for
        /// </summary>
        public string chartType { get; set; }
        
        public BaseOptions()
        {
            // Set Defaults
            backgroundColor = new BackgroundColor();
            chartArea = new ChartArea();
            legend = new Legend();
            tooltip = new ToolTip();
            titleTextStyle = new TextStyle();
            fontName = "Arial";
            fontSize = 12;
        }
    }
}